package cn.xiaobai.enums;

import cn.xiaobai.constants.CustomKeyConstants;

/**
 * 自动键枚举
 *
 * @Author yangdaji
 * @Date 2022/10/13 0013
 * @PackageName cn.xiaobai.enums
 * @ClassName RobotKeyEnum
 */
public enum RobotKeyEnum {

    VK_C(1, CustomKeyConstants.VK_C),
    VK_X(2, CustomKeyConstants.VK_X);

    private Integer keyId;
    private Integer keyCode;

    RobotKeyEnum(Integer keyId, Integer keyCode) {
        this.keyId = keyId;
        this.keyCode = keyCode;
    }

    public static Integer getKeyCode(Integer keyId) {
        for (RobotKeyEnum item : values()) {
            if (item.getKeyId().equals(keyId)) {
                return item.getKeyCode();
            }
        }
        return 1;
    }

    public Integer getKeyId() {
        return keyId;
    }

    public void setKeyId(Integer keyId) {
        this.keyId = keyId;
    }

    public Integer getKeyCode() {
        return keyCode;
    }

    public void setKeyCode(Integer keyCode) {
        this.keyCode = keyCode;
    }
}
